//
//  WBWebViewController.swift
//  TYCWeiBo
//
//  Created by tangyunchuan on 2018/7/30.
//  Copyright © 2018年 中发. All rights reserved.
//

import UIKit

class WBWebViewController: WBBaseViewController {

    private lazy var webView = UIWebView(frame: UIScreen.main.bounds)
    
    //要加载的URL字符串
    var urlString: String? {
        didSet{
            guard let urlString = urlString,
                let url = URL(string: urlString) else {
                return
            }
            
            
            webView.loadRequest(URLRequest(url: url))
        }
    }
    

}

extension WBWebViewController {
    override func setTableView() {
        
//        super.setTableView()
        //设置标题
        navItem.title = "网页"
        //设置webView
        view.insertSubview(webView, belowSubview: navigationBar)
        webView.backgroundColor = UIColor.white
        //设置 contentInset
        webView.scrollView.contentInset.top = navigationBar.bounds.height
    }
}
